{App::registerCoreScript('jquery')}
{App::registerCoreScript('colorbox')}
{App::registerCoreScript('base')}
{App::registerCoreStyle('colorbox')}
<table class="list ajax_edit">
	<tr>
		<th class="_20">Ред.</th>
		<th class="_20">Карт.</th>
		<th>Название</th>
		<th>Описание</th>
		<th>Владелец</th>
		<th class="_20">Аватара</th>
		<th class="_20">Комментарии</th>
		<th class="_20">Удл.</th>
	</tr>
	{foreach $images as $image}
		<tr class="save" rel="{$image->id}">
			<td class="center">
				<a rel="{$image->id}" href="#" class="edit"><img src="{$tpl_url}images/pencil.png"/></a>
			</td>
			<td class="center">
				<a href="{$image->src("500x500")}" rel="colorbox[gallery]" class="colorbox"><img style="max-height: 20px" src="{$image->src()}" /></a>
			</td>
			<td>
				{$image->title}
			</td>
			<td>
				{$image->description}
			</td>
			<td>
				{$image->Owner->login}
			</td>
			<td class="center">
				{if $image->ava == 1}
					<a href="{$base_url}&action=unava&id={$image->id}"><img src="{$tpl_url}images/label-green.png"/></a>
				{else}
					<a href="{$base_url}&action=ava&id={$image->id}"><img src="{$tpl_url}images/label-red.png"/></a>
				{/if}
			</td>
			<td class="center">
				{count($image->Comments)}
			</td>
			<td class="center">
				<a class="delete" href="{$base_url}&action=image_delete&id={$image->id}"><img src="{$tpl_url}images/trash.png"/></a>
			</td>
		</tr>
		<tr class="edit" rel="{$image->id}">
			{include file="image_form.html" image=$image}
		</tr>
	{/foreach}
	<tr>
		{include file="image_form.html" image=$_image}
	</tr>
</table>